<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>编辑栏目</title>
    <link rel="stylesheet" href="__STATIC__/layui/css/layui.css">
</head>
<body>
<form class="layui-form" id="label_edit_form" style="padding: 10px 20px 0 0;">
    <div class="layui-form-item">
        <label class="layui-form-label">标签名</label>
        <div class="layui-input-block"><input type="text" class="layui-input" name="label_name"
                                              value="{$label.label_name}"
                                              placeholder="请输入标签名"></div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">排序</label>
        <div class="layui-input-block"><input type="number" class="layui-input" name="order" value="{$label.order}"
                                              placeholder="数值越小越靠前"></div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">显示</label>
        <div class="layui-input-block">
            <input type="hidden" name="is_show" value="0">
            <input type="checkbox" name="is_show" value="1" lay-skin="switch" {$label.is_show==1?='checked'}>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <button type="button" class="layui-btn" onclick="labelEdit()">立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>
</form>
</body>
</html>
<script src="__STATIC__/layui/layui.all.js"></script>
<script src="__STATIC__/js/common.js"></script>
<script>
    function labelEdit() {
        let res = ajaxSubmit(document.getElementById('label_edit_form'), '{:url("label/labelEdit",["label_id"=>$label["id"],"_ajax"=>1])}', 'post');
        if (res) {
            closeOpen(1500);
        }
    }
</script>